<?php
namespace App\Admin\Controllers\Ext;

class Pos
{
    /**
     * add a grid here.
     */
    public function grid($grid,&$app)
    {

		if(!empty($app['sets']['pos']['poses'])){
			$poses = tag2arr($app['sets']['pos']['poses']);
			$app['grid_selectors']['pos'] = ['title'=>'位置','option'=>$poses,'scope'=>'pos','one'=>true];
			$grid->column('pos', '位置');	
		}
	}

    /**
     * add a form here.
     */
    public function form($form,$app,$id=0)
    {
		if( !empty($app['sets']['pos']['poses']) ){
			$form->tags('pos', '位置')->options(explode(",",$app['sets']['pos']['poses']));
		}
    }

    public function show($show,$app,$id=0)
    {
		$show->field('pos','位置');
	}
}
